package LocalDateTime;

import java.time.LocalDateTime;

public class LocateDateTimeDemo01 {
    public static void main(String[] args) {
        //method01();获取功能
        //method02();设置功能
        //method03();判断功能
    }

    private static void method03() {
        LocalDateTime dateTime = LocalDateTime.of(2013, 11, 12, 14, 20);
        LocalDateTime dateTime02 = LocalDateTime.of(2013, 12, 12, 14, 20);
        System.out.println(dateTime.isEqual(dateTime02));
    }

    private static void method02() {
        System.out.println(LocalDateTime.of(2013, 11, 12, 20, 40));
        LocalDateTime localDateTime = LocalDateTime.now().withHour(15).withMinute(33);
        System.out.println(localDateTime);
    }

    private static void method01() {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now.getYear());
        System.out.println(now.getMonthValue());
        System.out.println(now.getDayOfMonth());
        System.out.println(now.getHour());
        System.out.println(now.getMinute());
        System.out.println(now.getSecond());
    }
}
